1. Field of the Invention
The invention relates to USB network class devices and hosts and in particular to network class devices and hosts operating over the Universal Serial Bus 3.0.
2. Background Information
The Superspeed Universal Serial Bus, USB3.0, allows host computers, commonly referred to as “hosts,” and attached devices to communicate using data transfer rates that are many times higher than those available over its predecessor the USB2.0. The higher data transfer rates are particularly beneficial for network class devices. Network Control Model (“NCM”) modules in the host and the attached network class device operate with network and bus protocol layers to efficiently encapsulate network data into NCM Transfer Blocks (“NTBs”) and transport the NTBs over the USB as pluralities of serial bus packets.
The host and device agree on maximum NTB sizes for transfers over IN and OUT pipes, with the sizes differing for the respective pipes. The standard NCM module posts a receive request to the receiver containing one or more buffers with a total size as exactly the maximum NTB size agreed upon with the sender. The end of the transfer is indicated in the USB transmission by receipt of a maximum size NTB, i.e., an NTB that fills the buffer, or for non-maximum size NTBs, the receipt of one of the following USB packets: a USB packet containing less than the maximum amount of data, that is, a “short” packet; a USB packet containing no data, that is, a “zero length” packet or ZLP.
The USB controller at the receiving end of the transaction, for example, the USB controller in the attached device, readily processes maximum size NTBs when the full buffer flag is set, and processes the non-maximum NTBs when the device receives the associated end of transfer indicators. As appropriate, the device provides corresponding acknowledgments to the host. If all goes accordingly, the device thus processes the transfers without having to perform time consuming processing operations to determine the framing of the NTB in the data. The NTB transactions may thus be performed at the higher data transfer rates available over the USB3.0.
Various hosts, for example, hosts utilizing a particular Linux operating system kernel, do not provide the designated ends of transfer indicators for certain NTB transactions that are determined to be non-maximum transactions at the receiver. Rather the host has sent what it determines is a maximum size NTB, and therefore determines that an end of transfer indicator is not required.
The failure to provide the designated indicators adversely affects the transacting devices. The failure of the host to provide the expected end-of-transfer indicator for the non-maximum NTBs, means that the receiver cannot properly detect the end of the NTB, and the receiver will thus continue to receive the next NTB directly after the previous one into the same buffer or buffers that are designated to receive the NTBs. Therefore NCM framing synchronization will be lost, at least until the next time the host terminates a NTB with a short packet or a ZLP. All embedded frames during this period will thus be lost, with potentially severe consequences to the higher level protocol stacks.
What is needed is a mechanism that allows a receiver in an NTB transaction, in the example, an attached device, to determine if a sender, here a given host, is one that is compliant and provides the designated end-of-transfer indicators for NTB transactions that are non-maximum NTB transactions at the receiver. Further what is needed is a mechanism that allows devices to complete NTB transactions with the non-compliant host, and to complete them relatively efficiently.